<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
    <router-link to="/jiangtao">出门</router-link>
    <button @click="dataRoles">获取数据</button>
    <button @click="dataRoles01">获取数据01</button>
  </div>
</template>
 
<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: '我去瞅瞅'
    }
  },
  methods:{
    dataRoles(){
      var url = 'http://localhost:8081/static/data.json';
      this.$http.get(url).then(res =>{
        console.log(res.data)
      })
       /*$.get(url,function(data){
          console.log(data)
       })*/
    },
    dataRoles01(){
      var url01 = 'http://localhost:8081/api/seller';
      this.$http.get(url01).then(res =>{
        console.log(res)
      })
    }
  }
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
